<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/echarts.min.js"></script>
		<script src="js/jquery-3.4.0.min.js"></script>
		
		<!-- //按周展示访问走向(线性图) -->
		<div id="weekly_trend" style="width: 600px;height: 400px;">
			<script type="text/javascript">
				var myEchar = echarts.init(document.getElementById('weekly_trend'));
				myEchar.showLoading();
				myUser = {
					"userid": 1
				}
				$.ajax({
					contentType: "application/json;charset=utf-8",
					type: "put",
					url: "http://localhost:8082/mylog/getWeekTrend",
					data: JSON.stringify(myUser),
					dataType: "json",
					success: function(res) {
						console.log(res);
						if (res) {
							myEchar.hideLoading()
							myEchar.setOption({
								title: {
									text: '不同日期数据访问量',
									left: 'center'
								},
								xAxis: {
									type: 'category',
									data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
								},
								yAxis: {
									type: 'value'
								},
								series: [{
									data: res,
									type: 'line',
									smooth: true
								}]
							});
						}
					},
					error: function(errorMag) {
						alert("用户状态分析数据加载失败");
						myEchar.hideLoading();
					}
				});
			</script>
		</div>
	</head>
	<body>
	</body>
</html>
